{% extends 'base.html' %}

{% block title %}
    靓号管理
{% endblock %}

{% block content %}
    <div class="container">
        <div style="margin-bottom: 10px">
            <a href="/d2/bettry/add/" class="btn btn-success">
                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
                新增靓号
            </a>
            <div style="float: right; width: 200px">
                <form method="get">
                    <div class="input-group">
                        <input type="text" class="form-control" name="query" placeholder="Search for..."
                               value="{{ value }}">
                        <span class="input-group-btn">
                        <button class="btn btn-default" type="submit">
                        <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                    </button>
                    </span>
                    </div>
                </form>
            </div>
        </div>

        <div class="bs-example" data-example-id="bordered-table">
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>MOBILE</th>
                    <th>PRICE</th>
                    <th>LEVEL</th>
                    <th>STATUS</th>
                    <th>ACTION</th>
                </tr>
                </thead>
                <tbody>
                {% for bettry in bettrys %}
                    <tr>
                        <td>{{ bettry.id }}</td>
                        <td>{{ bettry.mobile }}</td>
                        <td>{{ bettry.price }}</td>
                        <td>{{ bettry.get_level_display }}</td>
                        <td>{{ bettry.get_status_display }}</td>
                        <td>
                            <a href="/d2/bettry/{{ bettry.id }}/edit/" class="btn btn-primary btn-xs">编辑</a>
                            <a href="/d2/bettry/{{ bettry.id }}/delete/" class="btn btn-danger btn-xs">删除</a>
                        </td>
                    </tr>
                {% endfor %}

                </tbody>
            </table>
        </div>

        <div aria-label="Page navigation">
            <ul class="pagination">
                {{ page_str }}
            </ul>
        </div>
    </div>
{% endblock %}